home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / SOURCE.BIN / Square.java < prev    next >
Encoding:
Java Source  |  1997-06-19  |  1014 b   |  39 lines

  1. package symantec.itools.awt.shape;
  2.  
  3. /**
  4.  * This is a square shape component.
  5.  * @version 1.0, Nov 26, 1996
  6.  * @author Symantec
  7.  */
  8.  
  9. public class Square
  10.     extends Rect
  11. {
  12.     /**
  13.      * Constructs a default Square.
  14.      */
  15.     public Square()
  16.     {
  17.     }
  18.  
  19.     /**
  20.      * Moves and/or resizes this component.
  21.      * This is a standard Java AWT method which gets called to move and/or
  22.      * resize this component. Components that are in containers with layout
  23.      * managers should not call this method, but rely on the layout manager
  24.      * instead.
  25.      *
  26.      * @param x horizontal position in the parent's coordinate space
  27.      * @param y vertical position in the parent's coordinate space
  28.      * @param width the new width
  29.      * @param height the new height
  30.      */
  31.     public void reshape(int x, int y, int width, int height)
  32.     {
  33.         this.width = this.height = this.width == width ? height : width;
  34.  
  35.         super.reshape(x, y, this.width, this.height);
  36.     }
  37. }
  38.  
  39.